package com.seata.logic.visualize.controller;

import com.seata.core.utils.Response;
import com.seata.logic.visualize.dto.DecreaseMoneyDto;
import com.seata.logic.visualize.service.TblUserMoneyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 蚂蚁会花呗
 * @date 2021/9/9 11:49
 */
@RestController
@RequestMapping("account/userMoney")
public class TblUserMoneyController {

    @Autowired
    private TblUserMoneyService tblUserMoneyService;

    /**
     * 扣钱费用
     * @return
     */
    @PostMapping("decreaseMoney")
    public Response decreaseMoney(@RequestBody DecreaseMoneyDto decreaseMoneyDto){
        tblUserMoneyService.decreaseMoney(decreaseMoneyDto.getUserId(),decreaseMoneyDto.getMoney());
        return Response.ok();
    }

}
